package org.jetlinks.protocol.official.mqtt.down.zigbeeGateway;

import org.jetlinks.core.message.function.FunctionInvokeMessage;
import org.jetlinks.protocol.official.TopicPayload;

/**
 * @Author bingzhong
 * @Date 2024/12/30 20:51
 * @Description
 */
public class ZigbeeGatewayDownHandler {

    public static TopicPayload encode(FunctionInvokeMessage functionInvokeMessage, String topicPatten) {

        String functionId = functionInvokeMessage.getFunctionId();
        ZigbeeGatewayFunctionIdEnum zigbeeGatewayFunctionIdEnum = ZigbeeGatewayFunctionIdEnum.valueOf(functionId);
        return zigbeeGatewayFunctionIdEnum.getFunction().apply(functionInvokeMessage, topicPatten);

    }


}
